home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / glibc-1.09 / glibc-1 / glibc-1.09.1 / sysdeps / unix / bsd / sun / sunos4 / termbits.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-31  |  7.1 KB  |  209 lines

  1. /* termios type and macro definitions.  SunOS 4 version.
  2. Copyright (C) 1993, 1994 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4.  
  5. The GNU C Library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Library General Public License as
  7. published by the Free Software Foundation; either version 2 of the
  8. License, or (at your option) any later version.
  9.  
  10. The GNU C Library is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13. Library General Public License for more details.
  14.  
  15. You should have received a copy of the GNU Library General Public
  16. License along with the GNU C Library; see the file COPYING.LIB.  If
  17. not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  18. Cambridge, MA 02139, USA.  */
  19.  
  20. /* Type of terminal control flag masks.  */
  21. typedef unsigned long int tcflag_t;
  22.  
  23. /* Type of control characters.  */
  24. typedef unsigned char cc_t;
  25.  
  26. /* Type of baud rate specifiers.  */
  27. typedef unsigned int speed_t;
  28.  
  29. /* Terminal control structure.  */
  30. struct termios
  31. {
  32.   /* Input modes.  */
  33.   tcflag_t c_iflag;
  34. #define    IGNBRK    0x0001        /* Ignore break condition.  */
  35. #define    BRKINT    0x0002        /* Signal interrupt on break.  */
  36. #define    IGNPAR    0x0004        /* Ignore characters with parity errors.  */
  37. #define    PARMRK    0x0008        /* Mark parity and framing errors.  */
  38. #define    INPCK    0x0010        /* Enable input parity check.  */
  39. #define    ISTRIP    0x0020        /* Strip 8th bit off characters.  */
  40. #define    INLCR    0x0040        /* Map NL to CR on input.  */
  41. #define    IGNCR    0x0080        /* Ignore CR.  */
  42. #define    ICRNL    0x0100        /* Map CR to NL on input.  */
  43. #ifdef __USE_BSD
  44. #define    IUCLC    0x0200        /* Map upper case to lower case on input.  */
  45. #endif
  46. #define    IXON    0x0400        /* Enable start/stop output control.  */
  47. #define    IXOFF    0x1000        /* Enable start/stop input control.  */
  48. #ifdef    __USE_BSD
  49. #define    IXANY    0x0800        /* Any character will restart after stop.  */
  50. #define    IMAXBEL    0x2000        /* Ring bell when input queue is full.  */
  51. #endif
  52.  
  53.   /* Output modes.  */
  54.   tcflag_t c_oflag;
  55. #define    OPOST    0x0001        /* Perform output processing.  */
  56. #ifdef    __USE_BSD
  57. #define    OLCUC    0x00000002    /* Map lower case to upper case on output.  */
  58. #define    ONLCR    0x00000004    /* Map NL to CR-NL on output.  */
  59. #define    OCRNL    0x00000008
  60. #define    ONOCR    0x00000010
  61. #define    ONLRET    0x00000020
  62. #define    OFILL    0x00000040
  63. #define    OFDEL    0x00000080
  64. #define    NLDLY    0x00000100
  65. #define    NL0    0
  66. #define    NL1    0x00000100
  67. #define    CRDLY    0x00000600
  68. #define    CR0    0
  69. #define    CR1    0x00000200
  70. #define    CR2    0x00000400
  71. #define    CR3    0x00000600
  72. #define    TABDLY    0x00001800
  73. #define    TAB0    0
  74. #define    TAB1    0x00000800
  75. #define    TAB2    0x00001000
  76. #define    XTABS    0x00001800
  77. #define    TAB3    XTABS
  78. #define    BSDLY    0x00002000
  79. #define    BS0    0
  80. #define    BS1    0x00002000
  81. #define    VTDLY    0x00004000
  82. #define    VT0    0
  83. #define    VT1    0x00004000
  84. #define    FFDLY    0x00008000
  85. #define    FF0    0
  86. #define    FF1    0x00008000
  87. #define    PAGEOUT    0x00010000
  88. #define    WRAP    0x00020000
  89. #endif
  90.  
  91.   /* Control modes.  */
  92.   tcflag_t c_cflag;
  93. #define    CSIZE    (CS5|CS6|CS7|CS8) /* Number of bits per byte (mask).  */
  94. #define    CS5    0        /* 5 bits per byte.  */
  95. #define    CS6    0x00000010    /* 6 bits per byte.  */
  96. #define    CS7    0x00000020    /* 7 bits per byte.  */
  97. #define    CS8    0x00000030    /* 8 bits per byte.  */
  98. #define    CSTOPB    0x00000040    /* Two stop bits instead of one.  */
  99. #define    CREAD    0x00000080    /* Enable receiver.  */
  100. #define    PARENB    0x00000100    /* Parity enable.  */
  101. #define    PARODD    0x00000200    /* Odd parity instead of even.  */
  102. #define    HUPCL    0x00000400    /* Hang up on last close.  */
  103. #define    CLOCAL    0x00000800    /* Ignore modem status lines.  */
  104. #ifdef    __USE_BSD
  105. #define    LOBLK    0x00001000
  106. #define    CRTSCTS    0x80000000
  107. #define    CIBAUD    0x000f0000    /* Mask for input speed from c_cflag.  */
  108. #define    CBAUD    0x0000000f    /* Mask for output speed from c_cflag.  */
  109. #define    IBSHIFT    16        /* Bits to shift for input speed.  */
  110. #endif
  111.  
  112.   /* Input and output baud rates.  These are encoded in c_cflag.  */
  113. #define B0      0
  114. #define B50     1
  115. #define B75     2
  116. #define B110    3
  117. #define B134    4
  118. #define B150    5
  119. #define B200    6
  120. #define B300    7
  121. #define B600    8
  122. #define B1200   9
  123. #define B1800   10
  124. #define B2400   11
  125. #define B4800   12
  126. #define B9600   13
  127. #define B19200  14
  128. #define B38400  15
  129. #ifdef __USE_BSD
  130. #define EXTA    14
  131. #define EXTB    15
  132. #endif
  133.  
  134.   /* Local modes.  */
  135.   tcflag_t c_lflag;
  136. #ifdef    __USE_BSD
  137. #define    ECHOKE    0x00000800    /* Visual erase for KILL.  */
  138. #endif
  139. #define    ECHOE    0x00000010    /* Visual erase for ERASE.  */
  140. #define    ECHOK    0x00000020    /* Echo NL after KILL.  */
  141. #define    ECHO    0x00000008    /* Enable echo.  */
  142. #define    ECHONL    0x00000040    /* Echo NL even if ECHO is off.  */
  143. #ifdef    __USE_BSD
  144. #define    ECHOPRT    0x00000400    /* Hardcopy visual erase.  */
  145. #define    ECHOCTL    0x00000200    /* Echo control characters as ^X.  */
  146. #endif
  147. #define    ISIG    0x00000001    /* Enable signals.  */
  148. #define    ICANON    0x00000002    /* Do erase and kill processing.  */
  149. #define    IEXTEN    0x00008000    /* Enable DISCARD and LNEXT.  */
  150. #define    TOSTOP    0x00000100    /* Send SIGTTOU for background output.  */
  151. #ifdef    __USE_BSD
  152. #define    PENDIN    0x00004000    /* Retype pending input (state).  */
  153. #endif
  154. #define    NOFLSH    0x00000080    /* Disable flush after interrupt.  */
  155.  
  156.   char c_line;            /* Line discipline (?) */
  157.  
  158.   /* Control characters.  */
  159. #define    VEOF    4        /* End-of-file character [ICANON].  */
  160. #define    VEOL    5        /* End-of-line character [ICANON].  */
  161. #ifdef    __USE_BSD
  162. #define    VEOL2    6        /* Second EOL character [ICANON].  */
  163. #define    VSWTCH    7        /* ??? */
  164. #endif
  165. #define    VERASE    2        /* Erase character [ICANON].  */
  166. #ifdef    __USE_BSD
  167. #define    VWERASE    14        /* Word-erase character [ICANON].  */
  168. #endif
  169. #define    VKILL    3        /* Kill-line character [ICANON].  */
  170. #ifdef    __USE_BSD
  171. #define    VREPRINT 12        /* Reprint-line character [ICANON].  */
  172. #endif
  173. #define    VINTR    0        /* Interrupt character [ISIG].  */
  174. #define    VQUIT    1        /* Quit character [ISIG].  */
  175. #define    VSUSP    10        /* Suspend character [ISIG].  */
  176. #ifdef    __USE_BSD
  177. #define    VDSUSP    11        /* Delayed suspend character [ISIG].  */
  178. #endif
  179. #define    VSTART    8        /* Start (X-ON) character [IXON, IXOFF].  */
  180. #define    VSTOP    9        /* Stop (X-OFF) character [IXON, IXOFF].  */
  181. #ifdef    __USE_BSD
  182. #define    VLNEXT    15        /* Literal-next character [IEXTEN].  */
  183. #define    VDISCARD 13        /* Discard character [IEXTEN].  */
  184. #endif
  185. #define    VMIN    VEOF        /* Minimum number of bytes read at once [!ICANON].  */
  186. #define    VTIME    VEOL        /* Time-out value (tenths of a second) [!ICANON].  */
  187. #define    NCCS    17
  188.   cc_t c_cc[NCCS];
  189. };
  190.  
  191. #define _IOT_termios /* Hurd ioctl type field.  */ \
  192.   _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
  193.  
  194. /* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'.  */
  195. #define    TCSANOW        0    /* Change immediately.  */
  196. #define    TCSADRAIN    1    /* Change when pending output is written.  */
  197. #define    TCSAFLUSH    2    /* Flush pending input before changing.  */
  198.  
  199. /* Values for the QUEUE_SELECTOR argument to `tcflush'.  */
  200. #define    TCIFLUSH    0    /* Discard data received but not yet read.  */
  201. #define    TCOFLUSH    1    /* Discard data written but not yet sent.  */
  202. #define    TCIOFLUSH    2    /* Discard all pending data.  */
  203.  
  204. /* Values for the ACTION argument to `tcflow'.  */
  205. #define    TCOOFF    0        /* Suspend output.  */
  206. #define    TCOON    1        /* Restart suspended output.  */
  207. #define    TCIOFF    2        /* Send a STOP character.  */
  208. #define    TCION    3        /* Send a START character.  */
  209.